home *** CD-ROM | disk | FTP | other *** search
- class disney.rabbitRivalry.scroller.ScrollerPanel extends smashing.keithm.Renderable
- {
- var __distRatio;
- var __z;
- var __currentAsset;
- var mc;
- var __mcs;
- var __fastScale;
- var z;
- var scale;
- var startScale;
- var x;
- var y;
- var loop;
- var DRAWTYPE = "bg";
- var __DEF_ASSET = "_empty";
- var CUSTOMDRAW = true;
- var __DRAW_ON_SPAWN = true;
- var __DEF_WIDTH = 800;
- var __DEF_HEIGHT = 800;
- var __USE_ACTUAL_DIMENSIONS = false;
- function ScrollerPanel(owner, t_distance, asset)
- {
- super({x:0,y:0,owner:owner});
- this.__distRatio = 1 - t_distance / 1000;
- this.__z = 1;
- this.__currentAsset = asset;
- }
- function onDraw(newmc)
- {
- super.onDraw(newmc);
- this.mc._x = 0;
- this.mc._y = 0;
- this.mc.attachMovie(this.__currentAsset,"bg" + this.__z,this.__z);
- this.mc.cacheAsBitmap = true;
- this.__mcs = [this.mc];
- }
- function onErase()
- {
- trace("I should not be erasable");
- }
- function render(camera, dt)
- {
- this.__fastScale = camera.fl / (this.z - camera.z);
- if(this.scale != this.__fastScale)
- {
- this.scale = this.__fastScale;
- this.mc._xscale = this.mc._yscale = 100 * (1 + (this.scale - this.startScale));
- }
- this.mc._x = (this.x - camera.x) * this.scale + camera.sc.x;
- this.mc._y = (this.y - camera.y) * this.scale + camera.sc.y;
- }
- function clear()
- {
- this.loop = this.__mcs.length;
- while(this.loop--)
- {
- this.__mcs[this.loop].removeMovieClip();
- }
- this.__mcs = [];
- }
- }
-